<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const map = [1, 2, 3, 35, 4, 8, 10, 7,11]
        // const result = map.reduce((sum,now) => sum + now)
        // console.log(result); 

        // const result = map.reduce((sum,now,index,arr)=>{
        //     sum +=now
        //     if (index == map.length -1) {
        //       return sum/index  
        //     }else{
        //         return sum
        //     }
        // })
        // console.log(result);
        let arr = []
        const num = map.reduce((prev, current) => {
            if (current >= 10) {
                arr.push(current);
                // return current;
            }
            return prev;
        }, null);
        console.log(arr);
    </script>
</body>

</html>